﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "GcmpDbCommonEdit.h"
#include "IElementTrimStrategy.h"

namespace gcmp
{
    class IElement;
    class IPolyCurve;
    class Coordinate3d;

    /// \brief 对象的基于PolyCurve的修剪策略接口。
    class GCMP_DB_COMMON_EDIT_EXPORT IElementTrimPolyCurveStrategy : public gcmp::IElementTrimStrategy
    {
        DEFINE_CAST_DERIVED(gcmp::IElementTrimPolyCurveStrategy, gcmp::IElementTrimStrategy);

    public:
        /// \brief 获取对象修剪操作的基准曲线。
        /// 
        /// \param pElement 修剪对象
        /// \return 返回对象修剪操作的基准曲线。
        virtual gcmp::OwnerPtr<gcmp::IPolyCurve> GetTrimBaseCurve(const gcmp::IElement* pElement) const = 0;

        /// \brief 获取对象基准坐标系。
        /// 
        /// \param pElement 修剪对象
        /// \return 返回对象基准坐标系。
        virtual gcmp::Coordinate3d GetPolyCurveCoordinate(const gcmp::IElement* pElement) const = 0;

        /// \brief 设置对象修剪操作后的基准曲线。
        /// 
        /// \param pElement 修剪对象
        /// \param opPolycurve 修剪后的基准曲线。
        /// \return 设置成功则返回true；否则返回false。
        virtual bool SetTrimBaseCurve(gcmp::IElement* pElement, gcmp::OwnerPtr<gcmp::IPolyCurve> opPolycurve) = 0;

    public:
        virtual ~IElementTrimPolyCurveStrategy();
    };
}
